package com.itheima.edu.info.manager.day6;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        jiShuanNianJianGe();
        //  panDuanRunNian();
        //  ak47();
//        Date date=new Date();
//        SimpleDateFormat sf=new SimpleDateFormat("y-MM-dd hh:mm:ss");
//        SimpleDateFormat sf1=new SimpleDateFormat("y-MM-dd  z hh:mm:ss");
//        System.out.println(sf.format(date));
//        System.out.println(sf1.format(date));
//        String name="老大爷";
//        String cs="2000-9-15";
//        Date.parse(name);
//        SimpleDateFormat spf=new SimpleDateFormat("y-M-dd");

    }

    public static void ak47() {
        LocalDateTime localDateTime = LocalDateTime.now();
        int year = localDateTime.getYear();
        int dayOfMonth = localDateTime.getDayOfMonth();
        int monthValue = localDateTime.getMonthValue();
        int hour = localDateTime.getHour();
        int minute = localDateTime.getMinute();
        System.out.println(year + "" + monthValue + "  " + dayOfMonth + "  " + hour + minute);
    }

    public static void panDuanRunNian() {//看是平闰年
        Scanner sc = new Scanner(System.in);
        int nian = sc.nextInt();
        LocalDate ld = LocalDate.of(nian, 3, 1);
        LocalDate localDate = ld.plusDays(-1);
        int dayOfMonth = localDate.getDayOfMonth();
        if (dayOfMonth == 28) {
            System.out.println("是平年");

        } else {
            System.out.println("是闰年");
        }
    }

    public static void jiShuanNianJianGe() {//计算of到当前过了多少天
        LocalDate ld = LocalDate.of(2000, 9, 15);
        LocalDate ld2 = LocalDate.now();
        long a = ChronoUnit.DAYS.between(ld, ld2);
        System.out.println(a);
    }
}

